package com.tuyue.police.pojo;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Date;

/**
 * @Author: 王金海
 * @Description:
 * @Date: Created by Administrator on 2018/4/28.
 * @Modified By:
 */
@Entity
@Table(name = "police_info", schema = "police", catalog = "")
public class PoliceInfo {
    private long pInfoId;
    private long pInfoDeviceId;
    private String pInfoServerIp;
    private String pInfoMainIp;
    private String pInfoMainProt;
    private String pSectorNumber;
    private byte pInfoState;
    private Date pInfoTime;
    private String pInfoAddress;
    private Double pInfoLon;
    private Long userId;
    private Double pInfoLat;

    @Id
    @Column(name = "p_info_id")
    public long getpInfoId() {
        return pInfoId;
    }

    public void setpInfoId(long pInfoId) {
        this.pInfoId = pInfoId;
    }

    @Basic
    @Column(name = "p_info_device_id")
    public long getpInfoDeviceId() {
        return pInfoDeviceId;
    }

    public void setpInfoDeviceId(long pInfoDeviceId) {
        this.pInfoDeviceId = pInfoDeviceId;
    }

    @Basic
    @Column(name = "p_info_server_ip")
    public String getpInfoServerIp() {
        return pInfoServerIp;
    }

    public void setpInfoServerIp(String pInfoServerIp) {
        this.pInfoServerIp = pInfoServerIp;
    }

    @Basic
    @Column(name = "p_info_main_ip")
    public String getpInfoMainIp() {
        return pInfoMainIp;
    }

    public void setpInfoMainIp(String pInfoMainIp) {
        this.pInfoMainIp = pInfoMainIp;
    }

    @Basic
    @Column(name = "p_info_main_prot")
    public String getpInfoMainProt() {
        return pInfoMainProt;
    }

    public void setpInfoMainProt(String pInfoMainProt) {
        this.pInfoMainProt = pInfoMainProt;
    }

    @Basic
    @Column(name = "p_sector_number")
    public String getpSectorNumber() {
        return pSectorNumber;
    }

    public void setpSectorNumber(String pSectorNumber) {
        this.pSectorNumber = pSectorNumber;
    }

    @Basic
    @Column(name = "p_info_state")
    public byte getpInfoState() {
        return pInfoState;
    }

    public void setpInfoState(byte pInfoState) {
        this.pInfoState = pInfoState;
    }

    @Basic
    @Column(name = "p_info_time")
    @Temporal(TemporalType.TIMESTAMP)
    public Date getpInfoTime() {
        return pInfoTime;
    }

    public void setpInfoTime(Date pInfoTime) {
        this.pInfoTime = pInfoTime;
    }

    @Basic
    @Column(name = "p_info_address")
    public String getpInfoAddress() {
        return pInfoAddress;
    }

    public void setpInfoAddress(String pInfoAddress) {
        this.pInfoAddress = pInfoAddress;
    }

    @Basic
    @Column(name = "p_info_lon")
    public Double getpInfoLon() {
        return pInfoLon;
    }

    public void setpInfoLon(Double pInfoLon) {
        this.pInfoLon = pInfoLon;
    }

    @Basic
    @Column(name = "user_id")
    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    @Basic
    @Column(name = "p_info_lat")
    public Double getpInfoLat() {
        return pInfoLat;
    }

    public void setpInfoLat(Double pInfoLat) {
        this.pInfoLat = pInfoLat;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        PoliceInfo that = (PoliceInfo) o;

        if (pInfoId != that.pInfoId) return false;
        if (pInfoDeviceId != that.pInfoDeviceId) return false;
        if (pInfoState != that.pInfoState) return false;
        if (pInfoServerIp != null ? !pInfoServerIp.equals(that.pInfoServerIp) : that.pInfoServerIp != null)
            return false;
        if (pInfoMainIp != null ? !pInfoMainIp.equals(that.pInfoMainIp) : that.pInfoMainIp != null) return false;
        if (pInfoMainProt != null ? !pInfoMainProt.equals(that.pInfoMainProt) : that.pInfoMainProt != null)
            return false;
        if (pSectorNumber != null ? !pSectorNumber.equals(that.pSectorNumber) : that.pSectorNumber != null)
            return false;
        if (pInfoTime != null ? !pInfoTime.equals(that.pInfoTime) : that.pInfoTime != null) return false;
        if (pInfoAddress != null ? !pInfoAddress.equals(that.pInfoAddress) : that.pInfoAddress != null) return false;
        if (pInfoLon != null ? !pInfoLon.equals(that.pInfoLon) : that.pInfoLon != null) return false;
        if (userId != null ? !userId.equals(that.userId) : that.userId != null) return false;
        if (pInfoLat != null ? !pInfoLat.equals(that.pInfoLat) : that.pInfoLat != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = (int) (pInfoId ^ (pInfoId >>> 32));
        result = 31 * result + (int) (pInfoDeviceId ^ (pInfoDeviceId >>> 32));
        result = 31 * result + (pInfoServerIp != null ? pInfoServerIp.hashCode() : 0);
        result = 31 * result + (pInfoMainIp != null ? pInfoMainIp.hashCode() : 0);
        result = 31 * result + (pInfoMainProt != null ? pInfoMainProt.hashCode() : 0);
        result = 31 * result + (pSectorNumber != null ? pSectorNumber.hashCode() : 0);
        result = 31 * result + (int) pInfoState;
        result = 31 * result + (pInfoTime != null ? pInfoTime.hashCode() : 0);
        result = 31 * result + (pInfoAddress != null ? pInfoAddress.hashCode() : 0);
        result = 31 * result + (pInfoLon != null ? pInfoLon.hashCode() : 0);
        result = 31 * result + (userId != null ? userId.hashCode() : 0);
        result = 31 * result + (pInfoLat != null ? pInfoLat.hashCode() : 0);
        return result;
    }
}
